package two_xia.ex7.Demo02;

public class Client {

    public static void main(String[] args) {

        OrganizationComponent beijing = new DeptComponent();
        beijing.setName("北京总部");

        OrganizationComponent jiaowuOffice1 = new Office();
        jiaowuOffice1.setName("教务办公室1");

        OrganizationComponent hunanfenxiao = new DeptComponent();
        hunanfenxiao.setName("湖南分校");

        OrganizationComponent xingzhengOffice = new Office();
        xingzhengOffice.setName("行政办公室1");


        OrganizationComponent jiaowuOffice2 = new Office();
        jiaowuOffice2.setName("教务办公室2");

        OrganizationComponent changshaJiaoxuediao = new DeptComponent();
        changshaJiaoxuediao.setName("长沙教学点");

        OrganizationComponent xiangtanjiaoxuedian = new DeptComponent();
        xiangtanjiaoxuedian.setName("湘潭教学点");

        OrganizationComponent xingzhengOffice2 = new Office();
        xingzhengOffice2.setName("行政办公室2");

        OrganizationComponent jiaowuOffice3 = new Office();
        jiaowuOffice3.setName("教务办公室3");

        OrganizationComponent xingzhengOffice3 = new Office();
        xingzhengOffice3.setName("行政办公室3");

        OrganizationComponent jiaowuOffice4 = new Office();
        jiaowuOffice4.setName("教务办公室4");

        OrganizationComponent xingzhengOffice4 = new Office();
        xingzhengOffice4.setName("行政办公室4");


        beijing.addComponent(jiaowuOffice1);
        beijing.addComponent(hunanfenxiao);
        beijing.addComponent(xingzhengOffice);


        hunanfenxiao.addComponent(jiaowuOffice2);
        hunanfenxiao.addComponent(changshaJiaoxuediao);
        hunanfenxiao.addComponent(xiangtanjiaoxuedian);
        hunanfenxiao.addComponent(xingzhengOffice2);

        changshaJiaoxuediao.addComponent(jiaowuOffice3);
        changshaJiaoxuediao.addComponent(xingzhengOffice3);

        xiangtanjiaoxuedian.addComponent(jiaowuOffice4);
        xiangtanjiaoxuedian.addComponent(xingzhengOffice4);

        beijing.sendMessage("北京总部发送公文");
        System.out.println("-----------------------------");

        changshaJiaoxuediao.sendMessage("发送公文");


    }

}